Skip to content

fix(core): give up on a stalled clip once, not every 8 seconds - #8850

Open
robinebers wants to merge 1 commit into
heygen-com:mainfrom
robinebers:pr/hold-give-up-sticks
Open

robinebers wants to merge 1 commit into
heygen-com:mainfrom
robinebers:pr/hold-give-up-sticks

Conversation

@robinebers

Copy link
Copy Markdown
Contributor

If a clip stops receiving data, the film holds for 8 s and then plays on. But the give-up was forgotten as soon as a single tick found the clip playable from data it already had. The next stall then held the film for another 8 s, with no new bytes. On one stalled file we saw nine holds of about 7.9 s in a row, and the film moved 0.04 s between them.

Now a clip that was given up stays given up until its buffered data grows or its currentSrc changes. Then the 8 s count starts again. Nothing changes for a clip that keeps receiving data.

There's a new test in init.buffering.test.ts. It fails on main with two holds where one is expected. One existing test needed a one-line change so that its data arrival counts as new data. Its assertion is the same, but it's worth a look in review.

…data arrives

The Buffering hold stops waiting for a clip 8 s after its buffered data last
grew, and the film plays on without it. The give-up lasted only while every
tick found the clip not ready: one tick where it could play a moment from the
data it already had reset the 8 s, so the next stall held the film again for
8 s with no new data. A clip whose download stalled for good then held the
film for 8 s, played a frame, and held again.

Once given up, a clip now stays given up until its buffered data grows or its
source changes; then the 8 s count starts again.

To reproduce: a clip plays, its download stops, the film holds 8 s and plays
on; the clip becomes ready for one tick from data it already has and starves
again. The film holds a second time for 8 s.

The test for a clip that starves again after playing now gives that clip the
data it plays from, so it still counts as new data.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant